import pandas as pd



# 如果excel表没有表头
people = pd.read_excel('C:/Users/LXL/Desktop/PandasVersusExcel/output - 副本.xlsx', header=None)
people.columns = ['ID', 'Name', 'a', 'b', 'c', 'd']  # 添加表头
people = people.set_index('ID')  # 将索引设为ID，避免直接将所以打印到表上
# 或者直接改
# people.set_index('ID',inplace=True) #将索引设为ID
print(people.columns)
people.to_excel('C:/Users/LXL/Desktop/PandasVersusExcel/output1.xlsx')  # 生成excel
print('Done!')
